<template>
page
</template>
<script setup>
useHead({
  title: "page",
  meta: [
    {
      name: "description",
      content: "page-description",
    },
  ],
  script: [
    {
      src: "https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js",
      body: true,
    },
  ],
});

const runtime = useRuntimeConfig();
// console.log(123,runtime.server,runtime.client,runtime.isServer)

const appConfig = useAppConfig();
console.log("获取全局的title", appConfig.title);

// 获取测试数据
const apiOption = {
  baseURL: "http://139.9.210.43:5000/",
  method: "GET",
};
const { data } = await useFetch("ceshi", {
  ...apiOption,
  params: {
    id: "123",
  },
  body: {},
  // 请求拦截器
  onRequest({ request, options }) {},
  // 响应拦截器
  onResponse({ request, options }) {},
});

console.log("测试数据1", data.value);

// 获取header信息
const headers = useRequestHeaders(["cookie"]);
console.log("获取header信息", headers);
</script>
<style scoped>
.page {
  color: red;
}
</style>
